colinuxfandomcom-20200214-history
Building a custom kernel
Category:Building = Debian 2.6.7-custom and reiser4 = I may have made some mistakes here, I typed the whole thing up and the wiki timed out, losing all of my edits so I kinda rushed through the 2nd time. * Note: You should not mix versions. That is you shouldn't use an snapshot to build a kernel, then use stable *.exes with it... This is very-likely to cause an reboot or plain not work. If you build a kernel from a version's source, be sure to use that versions binaries. Download the following # Kernel source http://www.kernel.org or use apt-get # coLinux snapshot http://www.colinux.org/snapshots # Reiser4 Vanilla http://kem.p.lodz.pl/~peter/cko/reiser4/ Test snapshot # stop any colinux instances that are running. # backup your .xml config file # backup your vmlinux file # (Optional) backup your vmlinux-modules.tar.gz file # install the exe from the snapshot to a different directory than your working version # copy your xml config over and make appropriate changes as needed. # make sure you can boot from the snapshot vmlinux. Configure Apt, and prep system # edit /etc/apt/sources.list change stable to sarge # run: apt-get update # run: apt-cache search kernel ||grep 2.6.7 # run: apt-get install kernel-source-2.6.7 # run: gcc –-version #* If your version is 2.9xx run: apt-get install gcc-3.3 # run: cd /usr/src; tar –jxvf #* this will be in the /usr/src dir if you grabbed it with apt #* check to see if you have kernel headers for the kernel version your trying to compile. something like dpkg -S kernel-head||wc -l # run: bunzip2 # copy the \patch\linux file some where on your colinux instance. # run: ln –s kernel-source-2.6.7 linux # run: cd /usr/src/linux # run: patch –p1 < colinux snapshot\patch\linux # run: patch –p1 < Build the kernel # make mrproper # copy the to /usr/src/linux/.config # run: make menuconfig #* tweak here at your own risk, you really just want to check for reiser4 support. #* you can edit the Makefile and add your custom kernel extension if you like here as well. # run: make vmlinux #* go get some coffee, check for make errors when done. If you get them one of us has done something wrong. You should have a vmlinux file 2.9MB at the top level directory (e.g: /usr/src/linux/vmlinux). Files with the name "vmlinux" in directories /usr/src/linux/arch/i386/boot or /usr/src/linux/arch/i386/boot/compressed are the wrong ones. # run: make modules modules_install #* If you want to create an vmlinux-modules.tar.gz, do INSTALL_MOD_PATH=, then tar/gzip the modules installed in that path into vmlinux-modules.tar.gz. Note that you need to tar inside that path (e.g. ./lib in /usr/src/modules/, and not /usr/src/modules/ itself). #*get more coffee if you need it. Get it running # make sure you’ve backed things up. # copy the vmlinux file from /usr/src/linux to your windows partition (* not good to overwrite the running copy *). # run: shutdown –h now #* this will bring your instance to powerdown state. If you didn’t know that, you should think twice about kernel hacking. # run: colinux-daemon.exe --remove-driver && colinux-daemon.exe --install-driver #* Sometimes I have found that running the --remove-driver && --install-driver twice in a row prevents a reboot. #* You can, also, use colinux-daemon --status-driver to see if the driver is up and functioning correctly. # wait for your disks to sync, I had 3 reboots before I had a working kernel to boot. # try to start it up, if it boots you need to make the reiser4 fs tools and you're off to the races. Known incompatibilities # Do not set CONFIG_REGPARM (this will make your host system reboot immediately when trying to start such a kernel). Building for Fedora Core 4 If you want to be able to boot a native/non-customized FC4 installation, you'll need a few features enabled that aren't in the default kernel: # Enable CONFIG_HOTPLUG (under "General setup", called "Support for hot-pluggable devices") # Enable CONFIG_MD (under "Device Drivers", "Multi-device support", top option) if using LVM (also see CoLinuxNativeRAID) # Enable CONFIG_EXT3_FS_XATTR (under "File Systems", "Ext3 extended attributs") # Enable CONFIG_EXT3_FS_SECURITY (just below) # Enable CONFIG_SECURITY_SELINUX (under "Security options", called "NSA SELinux support") and all sub-options You'll also need to use the Fedora mkinitrd tool to make an initrd.gz file (use all the --no-whatever options) and set up coLinux to use that. Related Pages Rebuilding co Linux with fuse-compatibility Explains how to rebuild the coLinux kernel to be compatible with fuse. ----MassTranslated on Sun Apr 23 17:35:37 UTC 2006